package com.zc.api.controller;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.http.HttpUtils;
import com.zc.custom.domain.ChargeCustomUser;
import com.zc.iotDevice.domain.ChargeStatisticsInfo;
import com.zc.iotDevice.mapper.ChargeStatisticsInfoMapper;
import com.zc.wxPay.util.Configure;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * @Author: gaojikun
 * @Description: 第三方调用接口
 * @Date: 2024/5/21 10:10
 * @Version: 1.0
 */
@RestController
@RequestMapping("/callApi")
public class CallAPIController {

    @Autowired
    private ChargeStatisticsInfoMapper chargeStatisticsInfoMapper;

    @GetMapping("/queryStatisticsInfoById")
    @ApiResponse
    public AjaxResult queryStatisticsInfoById(String deviceId) {
        if(deviceId == null || "".equals(deviceId)){
            return AjaxResult.error("参数错误");
        }
        ChargeStatisticsInfo chargeStatisticsInfo = new ChargeStatisticsInfo();
        chargeStatisticsInfo.setDeviceId(deviceId);
        List<ChargeStatisticsInfo> chargeStatisticsInfos = chargeStatisticsInfoMapper.queryStatisticsInfoById(chargeStatisticsInfo);
        return AjaxResult.success(chargeStatisticsInfos);
    }
}
